#if !defined(ximera_physics_ispace_hpp)
#define ximera_physics_ispace_hpp

// -----------------------------------------------------------

#include <ximera/enum.hpp>
#include <ximera/physics/ientity.hpp>
#include <ximera/physics/ijoint.hpp>

namespace ximera { namespace physics
{
    class IWorld;

    XIMERA_ENUM(SpaceType)
        Simple,
        Hash,
        QuadTree
    XIMERA_ENUM_END(SpaceType)

    class XIMERA_API ISpace
    {
    public:
		virtual ~ISpace();

        virtual SpaceType type() const = 0;

        virtual IWorld* world() const = 0;

        virtual IEntity* createEntity(EntityType type = EntityType::Dynamic) = 0;

        virtual UInt32 entityCount() const = 0;
        virtual IEntity* entity(UInt32 index) = 0;

        virtual void addEntity(IEntity* entity) = 0;
        virtual void removeEntity(IEntity* entity) = 0;
        virtual void removeAllEntities() = 0;

        virtual IJoint* createJoint(JointType type) = 0;

        virtual UInt32 jointCount() const = 0;
        virtual IJoint* joint(UInt32 index) = 0;

        virtual void addJoint(IJoint* joint) = 0;
        virtual void removeJoint(IJoint* joint) = 0;
        virtual void removeAllJoints() = 0;

        template <typename T>
        T* createJoint();
    };
}}

#include <ximera/physics/inline/ispace.inl>

// -----------------------------------------------------------

#endif
